﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _10继承
{
    class program
    {
        static void Main(string[] args)
        {
            student s = new student();

            //验证继承是否合理：子类  is a 父类
        }
    }

    //继承的好处：1.代码重用  2.多态
    //继承的特性：1.单根性（类只能单继承，不能多继承）2.传递性
    //父类比子类范围更大，更抽象。子类更具体。
    class person
    {
        public string name
        {
            get;
            set;
        }

        public int age
        {
            get;
            set;

        }

        public int height
        {
            get;
            set;
        }
    }

    class student : person
    {
        public string sno
        {
            get;
            set;
        }
    }

    class teacher : person
    {
        public double salary
        {
            get;
            set;
        }
    }
}
